<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    
    function Parent(m){
        this.msg = m;
    }
    Parent.prototype.show = function(){
        console.log(this.msg)
    }
    Parent.prototype.init = function(){
        console.log("init")
    }
    
    function Child(m){
        Parent.call(this, m);
    }
    for(let i in Parent.prototype){
        Child.prototype[i] = Parent.prototype[i];
    }

    const p = new Parent("hello");
    console.log(p);
    p.show()
    p.init();

    const c = new Child("world");
    console.log(c);
    c.show()
    c.init();

   
    // =========

    // 多继承


    


</script>
</html>